import java.util.*;

public class Main {

    public static void main(String[] args) {
        int count = 50;
        int[] nums = new int[]{10, 20, 10, 30, 50, 100, 60};
        Arrays.sort(nums);
        //寻找大于等于count数组下标
        int flag = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] >= count) {
                flag = i;
                break;
            }
        }
        //根据count分解成两部分
        int[] lessCountArray = Arrays.copyOf(nums, flag);
        List<Integer[]> note_list = new ArrayList<>();
        findSumCredits(lessCountArray, count);
        int index;
        if (lessCountArray.length > 1) {
            index = findMaxNumCredit(lessCountArray, count);
        }
        int[] moreCountArray = Arrays.copyOfRange(nums, flag, nums.length);
    }

    private static void findSumCredits(int[] lessCountArray, int count) {
        Deque<Integer> result = new ArrayDeque<>();
    }


    private static void findSumCredits(int[] lessCountArray, int count, int index, int sum) {
        if(sum+lessCountArray[index]==count){

        }

    }

    private static int findMaxNumCredit(int[] lessCountArray, int count) {
        int sum = 0;
        int index = 0;
        while (sum <= count && index < lessCountArray.length) {
            sum += lessCountArray[index];
            index++;
        }
        return index;
    }

}
